import{ defineStore} from 'pinia'
import axios from "axios"
import {nanoid} from 'nanoid'

export const useLoveTalkStore = defineStore('loveTalk',{
  actions:{
    async getLoveTalk(){
      let result = await axios.get('https://api.uomg.com/api/rand.qinghua')
      let obj ={id:nanoid(),title:result.data.content}
      this.talklist.unshift(obj)
   }
  },
  
  state(){
    return{
       talklist:[{id:'01',title:'hhhhh'}]
  }
}
})